//
//  MyOwnDrawView.swift
//  C019_drawRect_scrollView
//
//  Created by yao_yu on 15/6/24.
//  Copyright © 2015年 yao_yu. All rights reserved.
//

import UIKit

class MyOwnDrawView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        var aLabel = UILabel(frame: CGRectMake(20, 20, 200, 30))
        aLabel.text = "测试"
        addSubview(aLabel)
        
        aLabel = UILabel(frame: CGRectMake(2000, 20, 200, 30))
        aLabel.text = "测试2"
        addSubview(aLabel)
        
        aLabel = UILabel(frame: CGRectMake(20, 2000, 200, 30))
        aLabel.text = "测试3"
        addSubview(aLabel)
        
        aLabel = UILabel(frame: CGRectMake(2000, 2000, 200, 30))
        aLabel.text = "测试4"
        addSubview(aLabel)
        
    }

    required init(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    
    // Only override drawRect: if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func drawRect(rect: CGRect) {
        // Drawing code
        
        let context = UIGraphicsGetCurrentContext()
        CGContextAddArc(context, 300, 300, 30, 0, 30, 0)
        CGContextStrokePath(context)
        
        let aString:NSString = "中国人经常抱怨跨国公司在本土实行双重标准，比如中国的麦当劳没有免费续杯，必胜客的水果自助只能拿一次等等，但Uber的遭遇却鲜活的演示了实行国际标准的代价，中国人实在是太聪明了。还有一个问题是，刷单骗补这种事情，虽然涉及金额不大，但总归是诈骗，在中国却被熟视无睹，甚至淘宝上都有大批刷单交易公开买卖。"
        
        aString.draw
        
        print("自定义绘图")
    }
    
}
